﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SVTTranslateTextEngine.TestWeb.SVTTranslateTextEngine;

namespace SVTTranslateTextEngine.TestWeb
{
    public partial class TestTextToText : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnTranslate_Click(object sender, EventArgs e)
        {
            DateTime startDate = DateTime.Now;

            var reVal =
                new TTWebService().TranslateTextToText(new TextInputParam {  szFromLang=ddlFrom.SelectedValue,
                szToLang=ddlTo.SelectedValue, szFromText=txtSrc.Text, szVendorName="GOOGLE"});
            txtTrg.Text = Server.HtmlDecode(reVal.szToText);
            lblMsg.Text = "Uses Time : [" + (DateTime.Now - startDate).TotalMilliseconds + "]ms";
        }
    }
}
